import Vue from "vue";
import VueRouter from "vue-router";
import login from "../views/login/index.vue";
import layout from '../views/layout'
import home from '../views/home'
import my from '../views/my'
import qa from '../views/qa'
import video from '../views/video'
Vue.use(VueRouter);

// 路由映射数组
const routes = [
  {
    path: "/login",
    component: login,
  },
  {
    path: "/",
    component: layout,
    children:[{
      path: "",
      component: home,
    },{
      path: "my",
      component: my,
    },{
      path: "qa",
      component: qa,
    },{
      path: "video",
      component: video,
    },]
  },
];
// 实例化路由对象
const router = new VueRouter({
  routes,
});

export default router;
